<h1>Time cards List</h1>

<table>
    <thead>
        <tr>
            <th>Id</th>
            <th>Employee</th>
            <th>Pay period</th>
            <th>Actions</th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($time_cards as $time_card): ?>
            <tr>
                <td><a href="<?php echo url_for('timecards/show?id=' . $time_card->getId()) ?>"><?php echo $time_card->getId() ?></a></td>
                <td>
                    <a href="<?php echo url_for('timecards/show?payperiod=' .
                            $time_card->getPayPeriod()->getSlug() . "&employee=" .
                            $time_card->getEmployee()->getSlug() .
                            "&year=" . $time_card->getPayPeriod()->getYear() .
                            "&id=" . $time_card->getId())?>">
                    <?php echo $time_card->getEmployee() ?>
                </a>
            </td>
            <td><?php echo $time_card->getPayPeriod() ?></td>
            <td>
                <a href="<?php echo url_for('timecards/edit?id='.  $time_card->getId())?>">Edit
                </a>
            </td>
        </tr>
        <?php endforeach; ?>
                </tbody>
            </table>

            <a href="<?php echo url_for('timecards/new') ?>">New</a>
